package com.csg.ses.feign;

import com.alibaba.fastjson.JSONObject;
import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @auther wangjun
 * @time 2020/11/23
 * vcs机器人接口调用
 */
@FeignClient(name = "vcs", url = "http://10.150.175.54")
public interface PhpService {

    /**
     * 获取token
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/getToken.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> getToken(JSONObject params);

    /**
     * 获取机器人模板
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/getProjectList.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> getRobotTemplate(JSONObject params);

    /**
     * 创建任务
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/createTask.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> createTask(JSONObject params);

    /**
     * 添加外呼号码
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/pustPhones.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> pustPhones(JSONObject params);

    /**
     * 任务启动
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/resume.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> resume(JSONObject params);

    /**
     * 任务暂停
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/pause.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> pause(JSONObject params);

    /**
     * 获取任务列表
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/getTaskList.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> getTaskList(JSONObject params);

    /**
     * 获取任务详情
     * @param params
     * @return
     */
    @RequestMapping(path = "/vcs_api/openapi/getPhoneRun.php", method = RequestMethod.POST)
    @Headers(value = {"Accept=application/json", "ContentType=application/json;charset=utf-8"})
    ResponseEntity<String> getTaskDetails(JSONObject params);
}